package org.example;

import org.example.chrome.ChromeUtils;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.io.File;
import java.util.concurrent.TimeUnit;

public class MainUsePassWord {
    public static void main(String[] args) throws Exception {
        ChromeOptions options = new ChromeOptions();
        // 取消chrome正受到自动测试软件的控制的信息栏
        options.addArguments("--disable-blink-features=AutomationControlled");
//        options.setExperimentalOption("detach", true);
        options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"});
//        options.setExperimentalOption("useAutomationExtension", false);
        File f = ChromeUtils.create_proxyauth_extension("43.248.99.34", "51105", "2mjjzn", "1s4qnr8r");
        options.addExtensions(f);

        // 设备信息
        WebDriver DRIVER = new RemoteWebDriver(ChromeUtils.SERVICE.getUrl(), options);
        DRIVER.get("https://api.it120.cc/common/ip");
        TimeUnit.MINUTES.sleep(30);
    }
}